package com.itheima.anno;

import com.itheima.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import jakarta.validation.constraints.NotEmpty;

import java.lang.annotation.*;

/**
 * @author panweiwei
 */
//源注解
@Documented
//指定效验规则类
@Constraint(validatedBy = {StateValidation.class})
//元注解 指定生效方式
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface State {
    //提供效验失败后的信息
    String message() default "state只能是发布或者草稿";

    //指定分组
    Class<?>[] groups() default {};

    //负载 获取到state注解的附加信息
    Class<? extends Payload>[] payload() default {};

}
